package com.qu.waibao.my.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.qu.waibao.R;
import com.qu.waibao.base.BaseRecyclerAdapter;
import com.qu.waibao.bean.Hexiao;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @描述 describe
 * @作者 Administrator
 * @创建时间 2018/7/24 11:18
 * @邮箱 1123599561@qq.com
 */
public class ChildHeAdapter extends BaseRecyclerAdapter<Hexiao.TotalMonthBean.ChildBean> {
    public ChildHeAdapter(Context context, int mode) {
        super(context, mode);
    }

    @Override
    protected RecyclerView.ViewHolder onCreateDefaultViewHolder(ViewGroup parent, int type) {
        return new ChildHeViewHolder(mInflater.inflate(R.layout.heixao_child_recycler,parent,false));
    }

    @Override
    protected void onBindDefaultViewHolder(RecyclerView.ViewHolder holder, Hexiao.TotalMonthBean.ChildBean item, int position) {
        ChildHeViewHolder childHeViewHolder = (ChildHeViewHolder) holder;
        childHeViewHolder.tv_name.setText(item.getName());
        childHeViewHolder.tv_card.setText("编号："+item.getMyquancode());
        childHeViewHolder.tv_money.setText("¥"+item.getMoneysubtract());
        childHeViewHolder.tv_time.setText("核销时间："+item.getUsedtime());
    }

    class ChildHeViewHolder extends RecyclerView.ViewHolder{
        @BindView(R.id.tv_name)
        TextView tv_name;
        @BindView(R.id.tv_card)
        TextView tv_card;
        @BindView(R.id.tv_time)
        TextView tv_time;
        @BindView(R.id.tv_money)
        TextView tv_money;
        public ChildHeViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }
}
